package org.jeecg.modules.engineering.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.engineering.entity.EquipDataCollectorType;
import org.jeecg.modules.engineering.mapper.EquipDataCollectorTypeMapper;
import org.jeecg.modules.engineering.service.IEquipDataCollectorTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 供应商设备类型对应表
 * @Author: jeecg-boot
 * @Date:   2019-10-14
 * @Version: V1.0
 */
@Service
public class EquipDataCollectorTypeServiceImpl extends ServiceImpl<EquipDataCollectorTypeMapper, EquipDataCollectorType> implements IEquipDataCollectorTypeService {

    @Autowired
    private EquipDataCollectorTypeMapper equipDataCollectorTypeMapper;

    @Override
    public boolean checkHave(String sortId,String collectorId,String id) {
        long count = equipDataCollectorTypeMapper.getCount(sortId,collectorId,id);

        return count > 0;
    }

    @Override
    public IPage<EquipDataCollectorType> selectSqlList(Page<EquipDataCollectorType> page, EquipDataCollectorType equipDataCollectorType) {
        return page.setRecords(equipDataCollectorTypeMapper.selectSqlList(page,equipDataCollectorType.getCollectorId(),equipDataCollectorType.getSortId(),equipDataCollectorType.getCollectId()));
    }
}
